var express = require('express');
var router = express.Router();
var multer = require('multer');
var path = require('path');

// 单文件
const upload = new multer({ dest: 'upload' })
router.post("/upload", upload.single('file'), (req, res) => {
  const file = req.file
  const name = req.body.name
  const email = req.body.email
  console.log(file, name, email);
  if (!file) {
    res.send('File not found')
    return;
  }
  res.send('文件上传成功')
})

module.exports = router;
